package crm8000.services

import crm8000.Models.User;
import crm8000.helper.Result
import grails.transaction.Transactional

@Transactional
class UserService {

    def doLogin(String loginName, String password) {
		def user = User.findByLoginNameAndPassword(loginName, password.encodeAsMD5())
		
		if (user) {
			return new Result(success: true, id: user.userId)
		} else {
			return new Result(success: false, msg: "用户名或者密码错误")
		}
    }
}
